{ Russian Olympiad. 1 stage.
  Problemset: http://agul-problems1.googlecode.com/svn/trunk/2010-2011/roi/stage1/roi_1stage.doc
  Problem 3
  Points: 20
}
var n:int64; i,count:integer; res:array[1..1000001] of longint;
begin
assign(input,'input.txt');
assign(output,'output.txt');
reset(input);
rewrite(output);
readln(n);
if n=1 then writeln('1') else begin
  count:=0;
  for i:=9 downto 2 do begin
    while (n mod i)=0 do begin
      inc(count);
      res[count]:=i;
      n:=n div i;
    end;
  end;
  if (count=0) or (n<>1) then writeln('0') else begin
    for i:=count downto 1 do write(res[i]);
  end;
end;
close(input);
close(output);
end.